package com.abocode.aichat.server.handler;

import com.abocode.aichat.server.context.ServerRuntimeContext;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


/**
 * Created by franky-12.
 */
@ChannelHandler.Sharable
public class ProtocolServerInboundHandler extends ServerInboundHandler {

    private static final Log log = LogFactory.getLog(ProtocolServerInboundHandler.class);

    public ProtocolServerInboundHandler(ServerRuntimeContext serverRuntimeContext) {
        super(serverRuntimeContext);
    }

    public void registerChannel(Channel channel) {
        serverRuntimeContext.getProtocolChannelRegistry().register(channel);
    }

    public void unRegisterChannel(Channel channel) {
        serverRuntimeContext.getProtocolChannelRegistry().unregister(channel);
    }
}
